//
//  HomeCell.m
//  KiklinkApp
//
//  Created by LJC on 14-9-18.
//  Copyright (c) 2014年 Kiklink. All rights reserved.
//

#import "HomeCell.h"
#import "UIImageView+WebCache.h"

#import "UIColor+hex.h"

@implementation HomeCell

- (void)awakeFromNib
{
    self.contentView.backgroundColor = [UIColor colorWithHexString:AppColor_BackGround];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    self.imageLabel.adjustsFontSizeToFitWidth = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)loadData
{
    self.image.image = [UIImage imageNamed:@"placeHolder.png"];
    self.imageLabel.text = @"拳击-男人的运动";
    self.remarkLabel.text = @"激情与汗水";
    self.priceLabel.text = @"1.5";
}

- (void)loadDataWithProduct:(Product *)product
{
    self.imageLabel.text = product.name;
    self.remarkLabel.text = product.subname;
    self.priceLabel.text = [NSString stringWithFormat:@"%ld",(long)product.price];
    
    self.image.clipsToBounds = YES;
    [self.image sd_setImageWithURL:[NSURL URLWithString:[Base_Url stringByAppendingString:product.photo]] placeholderImage:[UIImage imageNamed:@"placeHolder.png"]];
}
@end
